package main

import (
	"game-time-management/service_manage"
	"game-time-management/types"
	"log"
	"os"

	"github.com/kardianos/service"
)

func main() {
	prg := &service_manage.MyProgram{}
	s, err := service.New(prg, types.SvcConfig)
	if err != nil {
		log.Fatal(err)
	}
	if len(os.Args) > 1 {
		err = service.Control(s, os.Args[1])
		if err != nil {
			log.Fatal(err)
		}
		return
	}
	s.Run()
}
